<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="${package_dao}.${Table}Mapper">
    <resultMap id="BaseResultMap" type="${package_model}.${Table}Entity">
        <#list models as model>
        <result column="${model.column}" property="${model.name}" jdbcType="${model.sqlType}"/>
        </#list>
    </resultMap>

    <sql id="Base_Param_Where">
        <where>
        <#list models as model>
            <if test="param.${model.name} != null">
                and ${model.column} = ${start}param.${model.name},jdbcType=${model.sqlType}}
            </if>
        </#list>
        </where>
    </sql>

    <sql id="Base_Column_List">
    <#list models as model>
    <#if model_has_next>
        ${model.column},
    <#else>
        ${model.column}
    </#if>
    </#list>
    </sql>

</mapper>